package javazuoye4;

public class zuoye08 {
     public static void main(String[] args) {
      String s="adcviwaknskncza";
         int b=aaa(s);
         System.out.println(b);
     }
    public static int aaa(String s) {

        int bb = 0;
        String s1 = "";

        for (int i = 0; i < s.length(); i++) {
            char cc = s.charAt(i);
            if (s1.indexOf(cc) == -1) {
                s1 += cc;
                bb = Math.max(bb, s1.length());
            } else {
                int index = s1.indexOf(cc);
                s1 = s1.substring(index + 1) + cc;
            }
        }

        return bb;
    }
}
